﻿-- =========================================================================================================
-- Author:		MICHAEL RITACCO
-- Copyright:	2010 MEKHANO GROUP LLC
-- Version:		10/02/2010 1.0
-- =========================================================================================================
CREATE PROCEDURE [flcr].[api_device_property_type_sel_lov]
@DEVICE_PROPERTY_TYPE_ID INT = NULL
,@DEVICE_TYPE INT = NULL
,@ACTIVE_FLG BIT = NULL

AS
BEGIN TRY
  
	SELECT	A.[DEVICE_PROPERTY_TYPE_ID]
			,A.[DEVICE_TYPE] 
			,A.[DEVICE_PROP_TYPE_NAME]
			,A.[PARENT_ID]
			,A.[SORT_ORDER] 
	  FROM	[FLCR].[DEVICE_PROPERTY_TYPE] A
     WHERE	A.[DEVICE_PROPERTY_TYPE_ID] = COALESCE(@DEVICE_PROPERTY_TYPE_ID,A.[DEVICE_PROPERTY_TYPE_ID])
	   AND	A.[DEVICE_TYPE] = COALESCE(@DEVICE_TYPE,A.[DEVICE_TYPE])
	   AND	A.[ACTIVE_FLG] = COALESCE(@ACTIVE_FLG,A.[ACTIVE_FLG])

END TRY
BEGIN CATCH
	EXEC [flcr].[utl_getDBError];
END CATCH
